package com.bwie.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author : LeiMingkun
 * @date : 2024-07-19 08:54
 * @description : R
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {
    private Integer code=200;
    private Object date="成功";
    private boolean flag=true;
    public static R success(Object data){
        R r = new R();
        r.setDate(data);
        return r;
    }
    public static R error(Object data){
        R r = new R();
        r.setCode(500);
        r.setFlag(false);
        r.setDate(data);
        return r;
    }
}